layui.define(['form', 'laydate', 'table', 'industrialTalentsApi'], function (exports) {
    var form = layui.form;
    var industrialTalentsApi = layui.industrialTalentsApi;
    var index = layui.index;
    var view = {
        init: function () {
            Lib.initGenrealForm($("#updateForm"), form);
            this.initSubmit();
        },
        initSubmit: function () {
            $("#acceptance-termination").click(function () {
                    form.on('submit(form)', function () {
                            Common.openConfirm("确认终止?", function () {
                                industrialTalentsApi.FirstTrialTermination($('#updateForm'), function () {
                                    Common.info("已终止");
                                    Lib.closeFrame();
                                    parent.forChildWindow();

                                });
                            }, null);
                    });
            });

            $("#acceptance-return").click(function () {

                    form.on('submit(form)', function () {
                            Common.openConfirm("确认退回?", function () {
                                industrialTalentsApi.initialReview($('#updateForm'), function () {
                                    Common.info("已退回");
                                    Lib.closeFrame();
                                    parent.forChildWindow();

                                });
                            }, null);

                    });
            });
            $("#acceptance-adopt").click(function () { if(document.getElementById("handlingSuggestion").value.trim() == ''){                 $("#handlingSuggestion").val("通过");             }
                if(document.getElementById("handlingSuggestion").value.trim() == ''){                 $("#handlingSuggestion").val("通过");             }
                form.on('submit(form)', function () {
                        var f = function() {
                            Common.openConfirm("确认通过?", function () {
                                industrialTalentsApi.FirstTrial($('#updateForm'), function () {
                                    Common.info("已通过");
                                    Lib.closeFrame();
                                    parent.forChildWindow();
                                });
                            }, null);
                        }
                        Common.validAll(f);
                    });
                });
        }
    }
    exports('chushenedit', view);

});